//
//  XMLParserWorkerNamedData.m
//  OR_1
//
//  Created by Luboš Kulič on 10/23/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "XMLParserWorkerNamedData.h"


@implementation XMLParserWorkerNamedData

-(id) init {
	return [self initWithName:@"<<XMLParserWorkerNamedData_DummyName>>"];
}

-(id) initWithName:(NSString *) name {
	if(self = [super initWithName:name]) {
		subelements = [[NSMutableDictionary dictionary] retain];
	}	
	return self;
}

-(void) dealloc {
	[subelements dealloc];
	[super dealloc];
}



-(NSString *) description {
	return [NSString stringWithFormat:@"Name: %@\n%@\nWorker Subelements: %@"
			, elementName, [super description], [subelements description]];
}



-(void) parserWillStartSubelement:(NSString *)elementName withWorker:(XMLParserWorker *)newWorker {
	NSLog(@"Adding named sublement: %@", elementName);

	[subelements setObject:newWorker forKey:elementName];
	//	NSLog(@"Count: %d", [subelements count]);
}

@end
